//
//  DHAddCaseViewController.m
//  发;fjag
//
//  Created by 刘鹏飞 on 2016/11/14.
//  Copyright © 2016年 刘鹏飞. All rights reserved.
//

#import "DHAddCaseViewController.h"
#import <Masonry.h>
#import "XHHAdditions.h"
#import "DHBaseClassView.h"
#import "DHDescribeView.h"

@interface DHAddCaseViewController ()

@end

@implementation DHAddCaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
}


#pragma mark - 创建子控件并布局子控件

-(void)xhhSetupNavigationItems {
    
    self.navigationItem.title = @"添加病例";
}

//创建并布局子控件
-(void)xhhSetupSubviews {
    
    //-------疾病分类视图--------//
    
    DHBaseClassView *classView = [DHBaseClassView baseClassWithNameLabel:@"疾病类型"];
    [self.view addSubview:classView];

    
    //-------疾病细分视图--------//
    DHBaseClassView *subdivideView = [DHBaseClassView baseClassWithNameLabel:@"疾病细分"];
    [self.view addSubview:subdivideView];

    
    //-------疾病描述视图--------//
    DHDescribeView *describeView = [DHDescribeView describeView];
    [self.view addSubview:describeView];

    //-------疾病图片添加视图--------//
    UIView *picView = [[UIView alloc] init];
    
    //添加子控件
    UILabel *picLabel = [UILabel XHH_labelWithText:@"病例图片:" fontSize:15 color:[UIColor blackColor]];
    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"AddPic"]];
    
    [self.view addSubview:picView];
    [picView addSubview:picLabel];
    [picView addSubview:imageView];
    

    
    //---------视图布局---------//
    
    //疾病分类视图布局
    [classView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.equalTo(self.view);
        make.top.equalTo(self.view).offset(64);
        make.height.mas_equalTo(40);
    }];
    //疾病细分视图布局
    [subdivideView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.equalTo(self.view);
        make.top.equalTo(classView.mas_bottom);
        make.height.mas_equalTo(40);
    }];
    //疾病描述视图布局
    [describeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.equalTo(self.view);
        make.top.equalTo(subdivideView.mas_bottom);
        make.height.mas_equalTo(220);
    }];
    //疾病图片视图布局
    [picView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.bottom.equalTo(self.view);
        make.top.equalTo(describeView.mas_bottom);
    }];
    [picLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(picView).offset(20);
        make.left.equalTo(picView).offset(8);
    }];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(picLabel.mas_bottom).offset(15);
        make.left.equalTo(picView).offset(15);
        make.size.mas_equalTo(CGSizeMake(105, 105));
    }];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
